﻿CREATE TABLE [dbo].[SeasonPlayerRankings] (
    [Id]              INT            IDENTITY (1, 1) NOT NULL,
    [SeasonId]        INT            NOT NULL,
    [PlayerId]        INT            NOT NULL,
    [AccountPoints]   INT            NOT NULL,
    [NumberOfMatches] INT            NULL,
    [InsertUser]      NVARCHAR (MAX) NOT NULL,
    [InsertDate]      DATETIME       NOT NULL,
    [UpdateUser]      NVARCHAR (MAX) NULL,
    [UpdateDate]      DATETIME       NULL,
    [Deleted]         BIT            NOT NULL,
    CONSTRAINT [PK_SeasonPlayerRanking] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_SeasonPlayerRanking_Players] FOREIGN KEY ([PlayerId]) REFERENCES [dbo].[Players] ([Id]),
    CONSTRAINT [FK_SeasonPlayerRanking_Season] FOREIGN KEY ([SeasonId]) REFERENCES [dbo].[Seasons] ([ID])
);

